package o;

import android.content.res.Resources;
import android.graphics.Rect;
import android.view.View;
import android.view.View.OnLayoutChangeListener;
import androidx.annotation.NonNull;

public class cvn implements OnLayoutChangeListener {
    private OnLayoutChangeListener ʻ;
    private boolean ˊ;
    private int ˋ;
    private int ˎ;
    private boolean ˏ = false;
    private View ॱ;

    public cvn(@NonNull View view, OnLayoutChangeListener onLayoutChangeListener) {
        this.ʻ = onLayoutChangeListener;
        this.ॱ = view;
        this.ˎ = -1;
        this.ˋ = -1;
        this.ˊ = false;
    }

    public void onLayoutChange(View view, int i, int i2, int i3, int i4, int i5, int i6, int i7, int i8) {
        Resources resources = view == null ? null : view.getResources();
        if (this.ॱ == null || resources == null) {
            cux.ˏ.ˊ("KeyBoardChangeListener", "The view or resources is null.");
            return;
        }
        if (this.ˊ) {
            this.ˊ = false;
        } else {
            this.ˋ = i4;
        }
        Rect rect = new Rect();
        this.ॱ.getWindowVisibleDisplayFrame(rect);
        int height = this.ॱ.getRootView().getHeight() - rect.bottom;
        int i9 = resources.getConfiguration().orientation;
        if (this.ˋ - i8 <= 0 || this.ˎ != i9 || height > epv.ˎ(resources)) {
            this.ˏ = false;
        } else {
            this.ˏ = true;
        }
        this.ˎ = i9;
        this.ʻ.onLayoutChange(view, i, i2, i3, i4, i5, i6, i7, i8);
    }

    public boolean ॱ() {
        return this.ˏ;
    }

    public void ˊ(boolean z) {
        this.ˊ = z;
    }
}
